import { http } from '@renderer/plugins/axios'
import { ref } from 'vue'
import useUtil from './useUtil'

export default () => {
  const peopleList = ref<staffPeopleModel[]>()

  const getStaff = useUtil().request(async (data: staffModel) => {
    try {
      peopleList.value = await http.request(
        {
          url: '/getStaff',
          method: 'POST',
          data,
        },
        { loading: false },
      )
    } catch (error) {
      console.log(error)
    }
  })
  return { getStaff, peopleList }
}
